package com.dahua.messageconsumer.sql;

import lombok.Data;

@Data
public class QueueTimes {
    public static volatile long countData = 0;
    public static volatile long count56 = 0;
    public static volatile long count56z = 0;
    public static volatile long countEquipmentFault = 0;
    public static volatile long countEquipmentFault_dh = 0;
    public static volatile long countUpload = 0;

    public static volatile long mqData = 0;
    public static volatile long mqSensorData = 0;
    public static volatile long mq56 = 0;
    public static volatile long mq56z = 0;
    public static volatile long mqEquipmentFault = 0;
    public static volatile long mqEquipmentFault_dh = 0;
    public static volatile long mqUpload = 0;

    public static volatile long tryData = 0;
    public static volatile long try56 = 0;
    public static volatile long try56z = 0;
    public static volatile long tryEquipmentFault = 0;
    public static volatile long tryEquipmentFault_dh = 0;
    public static volatile long tryUpload = 0;
    public static volatile long trySensorData = 0;

    // synchronized 影响效率，仅仅是统计
    public static void countDataP1() {
        countData++;
    }
    public static void count56P1() {
        count56++;
    }
    public static void count56zP1() {
        count56z++;
    }
    public static void countEquipmentFaultP1() {
        countEquipmentFault++;
    }
    public static void countEquipmentFault_dhP1() {
        countEquipmentFault_dh++;
    }
    public static void countUploadP1() {
        countUpload++;
    }

    public static void mqDataP1() {
        mqData++;
    }
    public static void mqSensorDataP1() {
        mqSensorData++;
    }
    public static void mq56P1() {
        mq56++;
    }
    public static void mq56zP1() {
        mq56z++;
    }
    public static void mqEquipmentFaultP1() {
        mqEquipmentFault++;
    }
    public static void mqEquipmentFault_dhP1() {
        mqEquipmentFault_dh++;
    }
    public static void mqUploadP1() {
        mqUpload++;
    }

    public static void clear() {
        countData = 0;
        count56 = 0;
        count56z = 0;
        countEquipmentFault = 0;
        countEquipmentFault_dh = 0;
        countUpload = 0;

        mqData = 0;
        mqSensorData = 0;
        mq56 = 0;
        mq56z = 0;
        mqEquipmentFault = 0;
        mqEquipmentFault_dh = 0;
        mqUpload = 0;

        tryData = 0;
        try56 = 0;
        try56z = 0;
        tryEquipmentFault = 0;
        tryEquipmentFault_dh = 0;
        tryUpload = 0;

        trySensorData = 0;
    }
}
